﻿@{
    var culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name.ToLowerInvariant();
}
@helper selected(string c, string culture)
    {
        if (c == culture)
        {
    @:selected="selected"
     }
     
}


<script type="text/javascript">
    $(function () {
        $("#culture").change(function () {

            if($("#culture").val()=="he"||$("#culture").val()=="he-IL")
            { 
//             var result=confirm("Changing your Language to Hebrew");
//             if(result)
             {
             @MobileWebsiteGenerator.MvcApplication.IsHebrew = true;
       
                 $(this).parents("form").submit(); // apply by posting form
                 }
           }
           else if($("#culture").val()=="en-us")
        {        
        //var result=confirm("Changing your Language to English");   
//           if(true)
           {
           @MobileWebsiteGenerator.MvcApplication.IsHebrew = false;
            $(this).parents("form").submit(); // apply by posting form
           }
           }
      
            
        });

        // highlight selected language
        //  $("input[type='radio']:checked").next().css("font-weight", "bold");
    });
</script>
@using (Html.BeginForm("SetCulture", "Home"))
{
    
<fieldset>

    <a href="@Url.Action("SetCulture", "Home", new { culture = "en-us" })">
        <img src="@Url.Content("~/images/American-flag-icon.gif")" alt="English" style="border-radius:3px;height:25px;width:25px;border:0px;" title="English" /></a>
    <a href="@Url.Action("SetCulture", "Home", new { culture = "he" })">
        <img src="@Url.Content("~/images/Saudi-Arabia-Flag.gif")" style="border-radius:3px;height:25px;width:25px;border:0px;" alt="Hebrew" title="Hebrew"/></a>
</fieldset>

    @*<fieldset>
        Please choose your language
        <select id="culture" name="culture">
            <option id="select" value="en-us"  @selected("en-us", culture)>Select..</option>
            <option id="en-us" value="en-us"  @selected("en-us", culture)>English</option>
            <option id="he" value="he" @selected("he", culture)>Hebrew</option>
            <option id="he-IL" value="he-IL" @selected("he-IL", culture)>Hebrew (Isrial)</option>
        </select>
    </fieldset>*@
}
